namespace PropertyExpression.ControllableQuery.Test.Queries.StringBuilding
{
    public class ModelPublicationQuery : IQuery<IModelPublicationInfo>
    {
        private readonly IParam<string> modelCode;
        private readonly IParam<string> modelSequence;

        public ModelPublicationQuery(
            IParam<string> modelCode,
            IParam<string> modelSequence)
        {
            this.modelCode = modelCode;
            this.modelSequence = modelSequence;
        }

        public string TransformText()
        {
            modelCode.ToSql("@ModelCode");
            modelSequence.ToSql("@ModelSequence");
            return @"SELECT
    ModelPublication.PublicationId,
    ModelPublication.ModelCode,
    ModelPublication.ModelSequence
FROM
    ModelPublication
WHERE
    ModelPublication.ModelCode = @ModelCode
    AND ModelPublication.ModelSequence = @ModelSequence";
        }
    }
}